TOOL.ClientConVar[ "r" ] = "255"
TOOL.ClientConVar[ "g" ] = "255"
TOOL.ClientConVar[ "b" ] = "255"
TOOL.ClientConVar[ "a" ] = "255"
TOOL.ClientConVar[ "outline" ] = "1"
TOOL.ClientConVar[ "model" ] = "models/Combine_Helicopter/helicopter_bomb01.mdl"

function TOOL:LeftClick( trace )

	if trace.Entity && trace.Entity:IsPlayer() then return false end
	if (CLIENT) then return true end	
	if ( !self:GetOwner():CheckLimit( "effects" ) ) then return false end

	local pos = trace.HitPos + trace.HitNormal * 10
	local ang = trace.HitNormal:Angle() - Angle( 90, 0, 0 )
	
	EntityColor = {}
	EntityColor["r"] = self:GetClientInfo("r")
	EntityColor["g"] = self:GetClientInfo("g")
	EntityColor["b"] = self:GetClientInfo("b")
	EntityColor["a"] = self:GetClientInfo("a")
	EntityModel = self:GetClientInfo("model")
	EntityOutlineNumber = self:GetClientInfo("outline")
	
	local lamp = ents.Create( "hmod_ball" )
	if (!lamp:IsValid()) then return end
	lamp:SetPos( pos )
	lamp:SetAngles( ang )
	lamp:Spawn()
	lamp:GetTable():SetPlayer( self:GetOwner() )
	
	self:GetOwner():AddCount( "effects", lamp )
	
	undo.Create("SENT")
	undo.AddEntity( lamp )
	undo.SetPlayer( self:GetOwner() )
	undo.Finish()

	self:GetOwner():AddCleanup( "effects", lamp )
	
	return true

end

function TOOL:RightClick( trace )

	return self:LeftClick(trace)
	
end 